@extends('layouts.app')

@section('content')
        <div class="header">
            <ul class="breadcrumb">
                <li>用户管理</li>
                <li><a href="">编辑用户</a> </li>
            </ul>
        </div>
        <div class="main-content">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#home" data-toggle="tab">编辑</a></li>
            </ul>

            <div class="row">
                <div class="col-md-6">
                    <br>
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane active in" id="home">
                            <form id="tab" class="form-horizontal" method="post">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">

                                @if($userinfo->dengji == 2)
                                    <ul id="diqu" class="filetree">
                                        @foreach($area1 as $v)
                                            <li class="open"><label class="Character"><input name="permissions[]" value="{{$v->id}}" type="checkbox" @if(in_array($v->id,$userinfo->area_id)) checked @endif></label>{{$v->name}}
                                            </li>
                                        @endforeach
                                    </ul>
                                @endif

                                @if($userinfo->dengji == 3)
                                    <ul id="diqu" class="filetree">
                                        @foreach($area1 as $v)
                                            <li class="open">{{$v->name}}
                                                <ul style="display: none">
                                                    @foreach($area2 as $v2)
                                                        @if($v2->cid==$v->id)
                                                            <li>
                                                                <label class="Character"><input name="permissions[]" value="{{$v2->id}}" type="checkbox" @if(in_array($v2->id,$userinfo->area_id)) checked @endif></label>{{$v2->name}}
                                                            </li>
                                                        @endif
                                                    @endforeach
                                                </ul>
                                            </li>
                                        @endforeach
                                    </ul>
                                @endif

                                @if($userinfo->dengji == 4)
                                <ul id="diqu" class="filetree">
                                    @foreach($area1 as $v)
                                        <li class="open">{{$v->name}}
                                            <ul style="display: none">
                                                @foreach($area2 as $v2)
                                                    @if($v2->cid==$v->id)
                                                        <li>
                                                            {{$v2->name}}
                                                            @foreach($area3 as $v3)
                                                                @if($v3->cid==$v2->id)
                                                                    <ul style="display: none">
                                                                        <li><label class="Character"><input name="permissions[]" value="{{$v3->id}}" type="checkbox" @if(in_array($v3->id,$userinfo->area_id)) checked @endif></label>{{$v3->name}}</li>
                                                                    </ul>
                                                                @endif
                                                            @endforeach
                                                        </li>
                                                    @endif
                                                @endforeach
                                            </ul>
                                        </li>
                                    @endforeach
                                </ul>
                                @endif

                                <div class="btn-toolbar list-toolbar btn-toolbar2">
                                    <button class="btn btn-primary">确定</button>
                                    <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>


@stop